<?php
/**
 * Created by PhpStorm.
 * User: USER
 * Date: 2018/11/13
 * Time: 11:05
 */

namespace app\controllers;
use yii\web\Controller;
use Yii;

class UploadController extends BaseController
{
    /** @var \common\logics\upload\UploadLogic $UploadService*/
    private $UploadService;

    public function init()
    {
        $this->UploadService = Yii::$container->get('UploadService');
        parent::init();
    }

    //上传图片方法
    public function actionUploadImg()
    {
        $upload_img_type = Yii::$app->request->post('upload_img_type');
        $result = $this ->UploadService ->uploadImg($upload_img_type);
        return $result;
    }
    //上传压缩图片方法
    public function actionUploadChangeImg()
    {
        $upload_img_type = Yii::$app->request->post('upload_img_type');
       $result = $this->UploadService->uploadChangeImage($upload_img_type);
       return $result;
    }
}